package com.haiya.factory.method.farm;

import com.haiya.factory.method.farm.animal.Animal;
import com.haiya.factory.method.farm.factory.CattleFarm;
import com.haiya.factory.method.farm.factory.Farm;
import com.haiya.factory.method.farm.factory.HorseFarm;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Client {
    public static void main(String[] args) throws IOException {
        BufferedReader strin = new BufferedReader(new InputStreamReader(System.in));
        System.out.println("input animal type: ");
        String type = strin.readLine();

        Animal animal = null;
        Farm farm;
        if (type.equals("horse")) {
            farm = new HorseFarm();
            animal = farm.newAnimal();
        } else if (type.equals("cattle")) {
            farm = new CattleFarm();
            animal = farm.newAnimal();
        }
        animal.show();
    }
}
